home *** CD-ROM | disk | FTP | other *** search
Text File | 1996-04-03 | 3.7 KB | 115 lines | [TEXT/MPS ] |
- // UDeskScrapView.h
- // Copyright © 1984-96 by Apple Computer, Inc. All rights reserved.
-
- #ifndef __UDESKSCRAPVIEW__
- #define __UDESKSCRAPVIEW__
-
- // MacApp
-
- #ifndef __UGEOMETRY__
- #include "UGeometry.h"
- #endif
-
- #ifndef __UVIEW__
- #include "UView.h"
- #endif
-
- //----------------------------------------------------------------------------------------
- // Forward and external class declarations
- //----------------------------------------------------------------------------------------
-
- class TDocument;
-
-
- //----------------------------------------------------------------------------------------
- // TDeskScrapView: The default view in the Clipboard, able to display only standard text
- // and pictures.
- //----------------------------------------------------------------------------------------
-
- class TDeskScrapView : public TView
- {
- MA_DECLARE_CLASS;
-
- public:
- //------------------------------------------------------------------------------------
- // Initialize and Free
- //------------------------------------------------------------------------------------
-
- TDeskScrapView();
- // Constructor
-
- void IDeskScrapView();
- // Initialize the deskscrap view procedurally.
-
- virtual ~TDeskScrapView();
- // Destructor.
-
- virtual void Free(); // override
- // Does nothing, don't ever want to free the clip orphanage.
-
-
- //------------------------------------------------------------------------------------
- // Stream I/O protocol support.
- //------------------------------------------------------------------------------------
-
- virtual void ReadFields(TStream* aStream);
- // Initialize the fScrapCount.
-
- //------------------------------------------------------------------------------------
- // Other methods
- //------------------------------------------------------------------------------------
-
- virtual void CheckScrapContents();
- // Checks the contents of the deskscrap.
-
- virtual VRect CalcMinFrame();
- // Responsible for calculating the correct size for the deskscrap view.
-
- virtual void Draw(const VRect& area);
- // Handles the drawing of the contents of the deskscrap, which by default is
- // either a PICT or text.
-
- virtual void SuperViewChangedFrame(const VRect& oldFrame,
- const VRect& newFrame,
- Boolean invalidate);
- // If our superview changes size then call AdjustSize & ForceRedraw.
-
- virtual void WriteToDeskScrap();
- // This view represents data that is already written to the deskscrap, so this
- // does nothing.
-
- //------------------------------------------------------------------------------------
- // static member functions
- //------------------------------------------------------------------------------------
- protected:
- static Boolean LookForScrapType(ResType theResType, ResType& resTypeFound);
-
- //------------------------------------------------------------------------------------
- // data members
- //------------------------------------------------------------------------------------
- public:
- Handle fDataHandle; // if non-NULL, will be either a PicHandle
- // to my picture or a Handle to my Text
-
- short fScrapCount; // scrapCount of the scrap represented by
- // this view.
-
- Boolean fHavePicture; // are we holding a PICT
-
- Boolean fHaveText; // is there any TEXT
-
- //----------------------------------------------------------------------------------------
- // static data members
- //----------------------------------------------------------------------------------------
- public:
- static Boolean gVarClipPicSize;
- // If true, pictures in the Clipboard are treated as variable size, depending on the
- // window size; if false (default), then pictures in the Clipboard are drawn and
- // pasted ??? actual size
-
- };
-
- #endif
-
-
-